package com.zde.moriserver.controller;

import com.dtflys.forest.annotation.Get;
import com.zde.moriserver.entity.GiftEntity;
import com.zde.moriserver.entity.GiftEntityRepository;
import com.zde.moriserver.result.Result;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 礼物接口
 */
@RestController
@RequestMapping("/gift")
@Tag(name = "礼物接口")
public class GiftController {

    @Autowired
    private GiftEntityRepository giftEntityRepository;

    /**
     * 查询所有礼物
     */
    @GetMapping("/getAllGift")
    public Result getAllGift(){
        List<GiftEntity> list = giftEntityRepository.list();
        return Result.success(list);
    }
}
